<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>管理后台-沽海交易</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        /* 清除浮动 */
        .clearfix:after {
            content: "";
            display: block;
            clear: both;
        }
        .clearfix {
            zoom: 1;
        }
        header img {
            width: 100%;
        }
        section{
            margin-top:30px ;
        }
        .login_form_box {
            margin: 0 auto;
            -webkit-border-radius: 12px;
            -moz-border-radius: 12px;
            -ms-border-radius: 12px;
            border-radius: 12px;
            padding: 40px 70px;
            width: 400px;
        }
        .field {
            margin: 40px 0px;
            border: 1px solid #f1f1f1;
        }
        .field label {
            display: block;
            height: 56px;
            background-color: #4e5ab0;
            float: left;
        }
        .field label img {
            padding: 10px 10px;
        }
        .field input {
            float: left;
            left: 50px;
            top: 0;
            width: 78%;
            height: 20px;
            line-height: 20px;
            padding: 18px 20px;
            background-color: #f7ffff;
            border: 0px;
            outline: none;
            font-size: 18px;
            color: #898989;
        }

        .rember_pwd {
            color: #58bbee;
            height: 15px;
            line-height: 15px;
            font-size: 16px;
            margin-bottom: 40px;
        }

        .rember_pwd input {
            height: 16px;
            outline: none;
        }

        .rember_pwd span {
            vertical-align: top;
            margin: 0 5px;
            line-height: 20px;
        }

        .login_bt {
            text-align: center;
        }
        .login_bt a {
            display: inline-block;
            text-decoration: none;
            width: 100%;
            height: 56px;
            line-height: 56px;
            font-size: 22px;
            color: #FFFFFF;
            background-color: #4e5ab0;
        }

        .fl {
            float: left;
        }

        .fr {
            float: right;
        }
        #saveid,#forget{
            display: inline-block;
            width: 20px;
            height: 20px;
        }
    </style>
</head>
<body>
<header>
    <img src="{$Think.config.DOMAIN_URL}/Public/AdminTpl/img/login-head.png">
</header>
<section>
    <div class="login_form_box">
        <form id="ajaxForm" method="post" action="">
            <div class="field username_field clearfix" style="margin-top:0px ">
                <label class="username_icon"><img src="{$Think.config.DOMAIN_URL}/Public/AdminTpl/img/login-icon1.png"/></label>
                <input id="username" name="username" type="text" placeholder="请输入您的用户名"/>
            </div>
            <div class="field password_field clearfix">
                <label class="password_icon"><img src="{$Think.config.DOMAIN_URL}/Public/AdminTpl/img/login-icon2.png"/></label>
                <input id="passwd" class="txt2" name="password" type="password" placeholder="请输入您的密码"/>
            </div>
            <div class="rember_pwd clearfix">
                <div class="fl"> <input  id="saveid" class="box" type="checkbox" value=""/><span style="color: #bfbfbf">记住密码</span></div>
                <div class="fr"> <span>忘记密码?</span></div>
            </div>
            <div class="login_bt">
                <a onclick="login()" style="cursor: pointer;">登录</a>
            </div>
        </form>
    </div>
</section>
</body>
<script src="{$Think.config.DOMAIN_URL}/Public/AdminTpl/js/jquery-2.1.1.min.js"></script>
<script src="{$Think.config.DOMAIN_URL}/Public/AdminTpl/layer/layer.js"></script>
<script>
    layer.config({
        offset: 't'
    });
    function login(){
        var userName = $('#username').val();
        if(userName.length == 0){
            layer.msg('请输入登录账号', {icon: 5,time: 1000,});return;
        }
        var userPwd = $('#passwd').val();
        if(userPwd.length == 0){
            layer.msg('请输入登录密码', {icon: 5,time: 1000,});return;
        }
        var __hash__ = $("input[name='__hash__']").val();
        var loginUrl = '{$Think.config.DOMAIN_URL}/login/login';
        $.post(loginUrl,{userName:userName,userPwd:userPwd,__hash__:__hash__},function(data){
            if(data.code == 0){
                location.href = '{$Think.config.DOMAIN_URL}';
            }else{
                layer.msg(data.msg, {icon: 5,time: 1000,});return;
            }
        });
    }
    $("body").keydown(function(event) {
        if (event.keyCode == "13") {
            login();
        }
    });

</script>
</html>